﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2020.models
{
    /// <summary>
    /// 加密类
    /// </summary>
    internal class MyEncoder
    {
        /// <summary>
        /// 明文
        /// </summary>
        public string PlainText { get; set; }
        /// <summary>
        /// 密文
        /// </summary>
        public string Cypher { get; set; }

        /// <summary>
        /// 密钥
        /// </summary>
        public string Key { get; set; }


        /// <summary>
        /// 加密动作
        /// </summary>
        public void Encoder()
        {
            //ToDo 加密过程
        }

        /// <summary>
        /// 返回指定字符在字母表中序号，从0开始
        /// </summary>
        /// /// <param name="args"></param>
        private int Function(char ch)
        {
            return ch - 'a';
        }

        /// <summary>
        /// 将序号为0~25的字符转换成字母
        /// </summary>
        /// <param name="x"></param>
        /// <returns></returns>
        private char IntToChar(int x)
        {
            return (char)(x % 26 + 'a');
        }



    }
}
